i=0
s=input('请输入一个8位2进制数:')
print("方向","距离")
while i<len(s):
    c=s[i:i+2]
    if c=="00":
        d="东"
    elif c=="01":
        d="南"
    elif c=="10":
        d="西"
    else:
        d="北"
    b1=int(s[i+2])
    b2=int(s[i+3])
    v=b1*2+b2
    print(d+"     "+str(v))
    i=i+4



